package com.shop.config;

//import com.shop.interceptors.JwtInterceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        registry.addViewController("/").setViewName("index");
        registry.addViewController("/index").setViewName("index");
        registry.addViewController("/index.html").setViewName("index");
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/myCart.html").setViewName("myCart");
        registry.addViewController("/myOrder.html").setViewName("myOrder");
        registry.addViewController("/register.html").setViewName("register");
        registry.addViewController("/goodsOfType.html").setViewName("goodsOfType");
        registry.addViewController("/orderPreview.html").setViewName("orderPreview");
        registry.addViewController("/singleShopping.html").setViewName("singleShopping");
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new JwtInterceptor()).addPathPatterns("/**");
    }
}
